<?php
//price
$price = Yii::app()->locale->numberFormatter->formatCurrency($model->price, 'EUR');
$orignal_picture = str_replace('thumb_', '', $model->url_picture);
$edit_btn = BUtils::T('edit_btn');

//name
$name = (empty($model->number) ? '' : $model->number . '. ') . $model->name;
?>
<div class="dishItem">
	<div class="basic-info relative">
		<div class="name"><?php echo $name; ?></div>
		<div class="price"><?php echo $price; ?></div>
		<div class="corner-br edit-button"><?php echo CHtml::link("<span>{$edit_btn}</span>", Yii::app()->createUrl('/menu/form', array('id'=>$model->id)), array('class'=>'button button-small button-thin button-confirm')); ?></div>
	</div>
	<div class="detail-info">
<?php if (!empty($model->url_picture)) { ?>
		<div class="picture">
			<a class="pic popupPicture" href="<?php echo $orignal_picture; ?>"><img src="<?php echo $model->url_picture; ?>" alt="" width="100" /></a>
		</div>
<?php } ?>
<?php if (!empty($model->sensitive_code)) { ?>
		<div style="margin-top:5px; font-weight:bold;"><?php echo $model->sensitive_code; ?></div>
<?php } ?>
<?php if (!empty($model->description)) { ?>
		<div class="description" style="max-width:300px">
			<?php echo nl2br(strip_tags($model->description)); ?>
		</div>
<?php } ?>
		<div class="clear"></div>
	</div>
</div>
<script type="text/javascript">
$(function() {
	$('.popupPicture').fancybox({
		transitionIn	:	'none',
		transitionOut	:	'none',
		changeSpeed : 0,
		overlayShow	:	true
	});
});
</script>